body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #222;
    font-family: Arial, sans-serif;
    color: #eee;
}

#game-container {
    text-align: center;
    background-color: #333;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    position: relative; /* Make game-container a positioning context for feedback message */
}

#game-elements {
    /* Apply rotation here instead of body */
    transform-origin: center center;
    transform: rotate(var(--game-elements-rotation-angle, 0deg)); /* Dynamic rotation */
    transition: transform 0.1s linear; /* Smooth rotation */
}

#gameCanvas {
    background-color: #000;
    border: 2px solid #555;
    display: block; /* Remove extra space below canvas */
    margin: 20px auto;
}

#score {
    font-size: 1.5em;
    margin-bottom: 5px; /* Reduced margin to bring timer closer */
}

#timer {
    font-size: 1.2em; /* Slightly smaller than score */
    margin-bottom: 10px; /* Space between timer and canvas */
}

#combo, #max-combo {
    font-size: 1.2em;
    margin-bottom: 5px;
}

#menu-container {
    padding: 20px;
}

.menu-selection {
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align label to the left */
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.menu-selection label {
    margin-bottom: 5px;
    font-size: 1em;
}

#songSelect, #modeSelect {
    padding: 8px;
    width: 100%;
    max-width: 300px;
    font-size: 1em;
    border-radius: 4px;
    border: 1px solid #555;
    background-color: #444;
    color: #eee;
    -webkit-appearance: none; /* Remove default arrow on WebKit browsers */
    -moz-appearance: none; /* Remove default arrow on Firefox */
    appearance: none; /* Remove default arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%204%205%22%3E%3Cpath%20fill%3D%22%23eee%22%20d%3D%22M2%200L0%202h4L2%200z%22%2F%3E%3C%2Fsvg%3E'); /* Custom arrow */
    background-repeat: no-repeat;
    background-position: right 0.7em top 50%;
    background-size: 0.65em auto;
}

#playSelectedButton {
    padding: 10px 20px;
    font-size: 1.2em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#playSelectedButton:hover {
    background-color: #45a049;
}

#feedback-message {
    position: absolute;
    top: 50px; /* Changed from 50% to 50px to position at the top */
    left: 50%;
    transform: translateX(-50%); /* Changed to only translate X, keeping it horizontally centered */
    font-size: 2.5em;
    font-weight: bold;
    color: #ffcc00; /* Yellowish color */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none; /* Allows clicks to pass through to canvas if needed */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.5s ease-out; /* For fading out */
    z-index: 100; /* Ensure it's on top of canvas */
}

/* New styles for "Too much" mode meters */
.meter-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #444;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 50; /* Above canvas, below feedback */
    display: none; /* Hidden by default, controlled by JS */
    flex-direction: column;
    align-items: center;
}

.meter-container h3 {
    margin-top: 0;
    font-size: 1.2em;
    color: #fff;
}

#score-o-meter-container {
    right: 20px; /* Position on the right side */
    width: 250px;
    height: 120px;
    justify-content: center;
}

#score-o-meter-bar {
    width: 200px; /* Width of the track */
    height: 20px;
    background-color: #666;
    border-radius: 10px;
    position: relative;
    margin-top: 10px;
    overflow: hidden; /* Ensure rectangle stays within bounds */
}

#score-o-meter-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 4px;
    height: 100%;
    background-color: #ff0000; /* Red line in the middle */
    transform: translateX(-50%);
    z-index: 1;
}

#score-o-meter-rect {
    width: 40px; /* Width of the moving rectangle */
    height: 100%;
    background-color: #00ff00; /* Green rectangle */
    border-radius: 10px;
    position: absolute;
    left: 0;
    top: 0;
    /* transform is controlled by JS */
}

#balance-o-meter-container {
    left: 20px; /* Position on the left side */
    width: 150px;
    height: 150px;
    justify-content: center;
}

#balance-o-meter-ring {
    width: 100px;
    height: 100px;
    border: 5px solid #666;
    border-radius: 50%;
    position: relative;
    margin-top: 10px;
    /* This ring itself is now static, elements inside rotate or move */
}

#balance-o-meter-rect { /* This is the moving rectangle inside the ring */
    width: 20px;
    height: 5px;
    background-color: #00aaff;
    position: absolute;
    top: 50%; /* Position its transform origin at the center of the ring */
    left: 50%;
    transform-origin: 50% 50%; /* Default, can be omitted, pivots around its own center */
    /* transform is controlled by JS */
}

#balance-o-meter-target-line {
    position: absolute;
    width: 2px;
    height: 20px; /* Length of the target line */
    background-color: #ff0000; /* Red line */
    top: -10px; /* Position half its height above the ring border, so it sits on top */
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
    z-index: 2; /* Ensure it's above the moving rect if it passes over */
}